package com.yxym.collection;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class CollectionMethod {
    @SuppressWarnings({"all"})
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add("jack");
        list.add(true);
        System.out.println("list" + list);
        list.remove(true);//删除元素
        System.out.println("list" +list);
        System.out.println(list.contains("jack."));//f查找元素是否存在
        System.out.println(list.size());//得到元素的个数
        list.clear();
        System.out.println("list" +list);
        ArrayList arrayList = new ArrayList();
        arrayList.add("三国");
        arrayList.add("水浒");
        list.addAll(arrayList);
        System.out.println("list" +list);
        System.out.println(list.containsAll(list));//t
        list.removeAll(arrayList);
        System.out.println("list" +list);


    }
}
